
		\centering
		\begin{center}
			\begin{tikzpicture}[-stealth,scale=1.6,transform shape,node distance = 1em]
				\tikzstyle{every node}=[font=\small,scale=0.8]
				\begin{scope}[minimum height = 1pt]
					\tikzstyle{inout}=[trapezium, trapezium left angle=60, trapezium right angle=120, draw] %%输入输出框
					\tikzstyle{mid}=[rectangle,  opacity=0,draw] 
					\tikzstyle{end}=[rectangle, rounded corners, draw]   %%教材上的起止框
					\tikzstyle{endn}=[rounded rectangle, draw]   %%新版的起止框
					\tikzstyle{exec}=[rectangle, draw]    %%执行框 execute
					\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black]  % 平行四边形
					\tikzstyle{decide}=[diamond,aspect=2,draw,thin]   %%判断框 opacity=0.3
					\node[end] (s) at (0,0) {开始};
					\node at ([xshift=-4em,yshift=0em]s.west){简单优先控制器};
					\node[anchor=south,inner sep=2pt] (m1) at ([yshift=-2em]s.south) {PUSH(\#)};
					\node[mid] [below= of s][fit = (m1)] (s1){};
					\node[anchor=south] (m2) at ([yshift=-2em]s1.south) {NEXT(w)};
					\node[mid] [below= of s1][fit = (m2)] (s2){};
					\node[exec] (s3)[align=center,below= of s2] {查优先分析表\\R(Xk,w)=?};
					\node[decide] (d1) [below= of s3] {空?};
					\node[decide] (d2) [below= of d1] {·>?};
					\node[decide] (d3) at ([xshift=10em,yshift=0em]d2.east) {(\#S\#)?};
					% \node[io] (i1) [below= of d2] {回答:ok};
					% \node[end] (e1) [below= of i1] {结束};
					% \node[io](i2) [left= of d2] {回答:no};
					\node[exec] (s4) [align=center]at ([xshift=0em,yshift=5em]d3.north) {$\mathbf{s}_{\mathbf{j}}$(栈顶符)开始，往栈内查找，\\ 找到第一个使$\mathbf{s}_{\mathrm{i}-1}<\cdot \mathbf{s}_{\mathrm{i}}$的$\mathbf{s}_{\mathbf{i}}$(句柄的头)\\用$\mathbf{s}_{\mathbf{i}} \mathbf{s}_{\mathbf{i}+1} \ldots \mathbf{s}_{\mathrm{j}}$去查文法产生式，若有A $\rightarrow s_{i} s_{i+1} \ldots s_{j}$,\\则:POP($\mathbf{s}_{\mathrm{j}}$),POP($\mathbf{s}_{\mathrm{j-1}}$),POP($\mathbf{s}_{\mathrm{i}}$);PUSH(A)};
					\node[anchor=south] (a1) at ([xshift=-2em]s3.west) {PUSH};
					\node[anchor=south] (a2) at ([xshift=1.5em,yshift=-0.5em]d1.east) {err};
					\node (k1)at ([xshift=-4em,yshift=-1em]d2.south){\color{blue}{Xk:栈顶符;}};
					
					\draw (s) -- (m1.north);
					\draw (m1.south) -- (m2.north);
					\draw (m2.south) -- (s3.north);
					\draw (s3) -- (d1);
					\draw (d1) -- node[left]{n}(d2);
					\draw (d2) -- node[above]{y}(d3);
					\draw (d3.north) -- node[left]{n}node[right]{归约}(s4);
					\draw (d1) -- node[above]{y}(a2);
					\draw (d2.west) -| node[left]{n}(a1);
					\draw (a1) |- node[above]{移进W}([xshift=-0.05em,yshift=-0.5em]m1.south);
					\draw (s4.north) -- ([xshift=0em,yshift=2em]s4.north) -| ([xshift=-10em,yshift=2em]s4.north) -- ([xshift=-10em,yshift=-0.15em]s4.north) --([xshift=-0.05em,yshift=-0.8em]m2.south);
					\begin{pgfonlayer}{background}
						\node [fill=red!10,fit=(k1)] {};
					\end{pgfonlayer}
					
				\end{scope}
			\end{tikzpicture}
		\end{center}
